bitkeeper revision 1.1236.3.1 (421f2a35S4BT09otLbDXG1U-Qs355g)
authormaf46@burn.cl.cam.ac.uk <maf46@burn.cl.cam.ac.uk>
Fri, 25 Feb 2005 13:37:57 +0000 (13:37 +0000)
committermaf46@burn.cl.cam.ac.uk <maf46@burn.cl.cam.ac.uk>
Fri, 25 Feb 2005 13:37:57 +0000 (13:37 +0000)
Added some defensive code to notice when we're run out of
map cache entries.

Signed-off-by: michael.fetterman@cl.cam.ac.uk
xen/arch/x86/x86_32/domain_page.c

index 56665137197fad5d8fbb9114c16e8110180b32e8..e3aa720c78969c000a7e62f070112cdea8fe2b74 100644 (file)
@@ -44,6 +44,9 @@ void *map_domain_mem(unsigned long pa)
     unsigned long va;
     unsigned int idx, cpu = smp_processor_id();
     unsigned long *cache = mapcache;
+#ifndef NDEBUG
+    unsigned flush_count = 0;
+#endif
 
     ASSERT(!in_irq());
     perfc_incrc(map_domain_mem_count);
@@ -66,6 +69,13 @@ void *map_domain_mem(unsigned long pa)
             perfc_incrc(domain_page_tlb_flush);
             local_flush_tlb();
             shadow_epoch[cpu] = ++epoch;
+#ifndef NDEBUG
+            if ( unlikely(flush_count++) )
+            {
+                // we've run out of map cache entries...
+                BUG();
+            }
+#endif
         }
     }
     while ( cache[idx] != 0 );